package xianchengpool;

import java.util.concurrent.*;

/**
 * @功能
 * @创建时间 2019/12/26
 * 操作executor的一个工具类，以上所有东西
 */
public class T04_Executors {
    static ExecutorService service =  new ThreadPoolExecutor(5,10, 10,TimeUnit.SECONDS,new LinkedBlockingQueue<>());

    public static void main(String[] args) {
        int[] a ={1,2,3,4,5};
        Future<Integer> res = service.submit(()->{
            int j = 1/0;
            return 1;
        });
        try {
            res.get();
        } catch (Exception e) {
            e.printStackTrace();
        }

    }
}
